﻿using System;
using System.ComponentModel.DataAnnotations;
using eCRAM.Model;

namespace eCRAM.WebSite.Models
{
    public class ParameterModel
    {
        public Guid Id { get; set; }
        [Display(Name = "Nom")]
        public string Name { get; set; }

        [Display(Name = "Description")]
        public string Description { get; set; }

        [Display(Name = "Valeur")]
        public string Value { get; set; }

        public static ParameterModel FromParameter(Cram_Parameter param)
        {
            return new ParameterModel { Description = param.Description, Id = param.Id, Name = param.Name, Value = param.Value };
        }

        public Cram_Parameter ToParameter()
        {
            return new Cram_Parameter { Description = this.Description, Id = this.Id, Name = this.Name, Value = this.Value };
        }
    }
    
}